print(Duktape.enc('jx',iot));
var ringbuffer = new iot.RingBuffer(3,iot.WriteMode.REPLACE);

assert(ringbuffer.length == 0,"ringbuffer.length == 0 but length:"+ringbuffer.length)
var buf = Uint8Array.allocPlain(10)
print('write 10')
var writed = ringbuffer.write(buf)
ringbuffer.dump();
assert(writed == 10,"writed == 10 but writed "+writed)
assert(ringbuffer.length == 2,"ringbuffer.length == 2 but length:"+ringbuffer.length)
